package com.syt.service.service;

import com.syt.service.dao.SocMapper;
import com.syt.service.pojo.Soc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author syt
 */
@Service
public class SocService {

    @Autowired(required = false)
    SocMapper socMapper;

    /**
     * 删除根据id
     * @param socId
     * @return
     */
    public int deleteById(Integer socId) {
        return socMapper.deleteByPrimaryKey(socId);
    }

    /**
     * 完全插入soc
     * @param soc
     * @return
     */
    public int insert(Soc soc) {
        return socMapper.insert(soc);
    }

    /**
     * 选择插入soc数据
     * @param soc
     * @return
     */
    public int insertBySelective(Soc soc) {
        return socMapper.insertSelective(soc);
    }

    /**
     * 根据id查询soc
     * @param socId
     * @return
     */
    public Soc getById(Integer socId) {
        return socMapper.selectByPrimaryKey(socId);
    }

    /**
     * 选择性更新soc数据
     * @param soc
     * @return
     */
    public int updateBySelective(Soc soc) {
        return socMapper.updateByPrimaryKeySelective(soc);
    }

    /**
     * 完全更新soc数据
     * @param soc
     * @return
     */
    public int update(Soc soc) {
        return socMapper.updateByPrimaryKey(soc);
    }

    /**
     * 根据name删除soc数据
     * @param socName
     * @return
     */
    public int deleteByName(String socName) {
        return socMapper.deleteByName(socName);
    }

    /**
     *  查询所有soc数据
     * @return allSoc
     */
    public List<Soc> AllListSoc() {
        return socMapper.allSoc();
    }

}
